<?php
class User extends Model
{
    protected $_partialOrder = '_pk ASC';

    public static function instance(){
        static $obj;
        if(!$obj) $obj = new self();
        return $obj;
    }

	function getByName($name)
	{
        return $this->getList(array('name'=>$name), 0, 1);
	}

	/**
	 * 取虚拟角色ID
	 */
	function getVirtualRoleId($user_id)
	{
        return $this->getCol($user_id, 'role_id');
	}
	
}
?>
